package com.logictech.lims.web.api;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.velocity.VelocityContext;
import org.jeecgframework.p3.core.common.utils.AjaxJson;
import org.jeecgframework.p3.core.util.SystemTools;
import org.jeecgframework.p3.core.util.plugin.ViewVelocity;
import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.logictech.lims.dto.PreparationTypeDto;
import com.logictech.lims.entity.Location;
import com.logictech.lims.entity.Position;
import com.logictech.lims.entity.PreparationType;
import com.logictech.lims.service.LocationService;
import com.logictech.lims.service.PositionService;
import com.logictech.lims.service.PreparationTypeService;
import com.logictech.wechat.model.responseDto.JsonResp;

/**
 * 描述：</b>PreparationTypeController<br>
 * 
 * @author guoqi
 * @since：2017年03月21日 16时10分42秒 星期二
 * @version:1.0
 */
@Controller
@RequestMapping("/lims/api/preparationType")
public class ApiPreparationTypeController extends BaseController {
	@Autowired
	private PreparationTypeService preparationTypeService;
	
	/**
	 * 获取试液列表
	 * 
	 * @param request
	 * @return
	 */
	@RequestMapping(value = { "/getPreparationTypeList" }, produces = "application/json",method = { org.springframework.web.bind.annotation.RequestMethod.GET,
			org.springframework.web.bind.annotation.RequestMethod.POST })
	@ResponseBody
    public JsonResp<List<PreparationTypeDto>> getPreparationTypeList(@RequestBody PreparationTypeDto preparationTypeDto){
	    
        List<PreparationTypeDto> preparationTypeList = this.preparationTypeService.queryAll(preparationTypeDto.getName());
        JsonResp<List<PreparationTypeDto>> resp = new JsonResp<List<PreparationTypeDto>>();
        resp.setInfo(preparationTypeList);
        return resp;
    }
	
}
